home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_kdelibs.idb / usr / freeware / kde / include / kprocctrl.h.z / kprocctrl.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  2.1 KB  |  76 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.     Boston, MA 02111-1307, USA.
  18. */
  19. //
  20. //  KPROCESSCONTROLLER -- A helper class for KProcess
  21. //
  22. //  version 0.3.1, Jan 8th 1997
  23. //
  24. //  (C) Christian Czezatke
  25. //  e9025461@student.tuwien.ac.at
  26. //
  27.  
  28. #ifndef __KPROCCTRL_H__
  29. #define __KPROCCTRL_H__
  30.  
  31.  
  32. #include <qsocknot.h>
  33. #include "kprocess.h"
  34.  
  35. /**
  36. @short A class for internal use by KProcess only
  37. @author Christian Czezakte e9025461@student.tuwien.ac.at
  38.   A class for internal use by KProcess only. -- Exactly one instance
  39.   of this class is generated by the first instance of KProcess that is
  40.   created (a pointer to it gets stored in "theKProcessController").
  41.  
  42.   This class takes care of the actual (UN*X) signal handling.
  43. */
  44. class KProcessController : public QObject
  45. {
  46.   Q_OBJECT
  47.  
  48. public:
  49.   KProcessController();
  50.   ~KProcessController(); 
  51.   //CC: WARNING! Destructor Not virtual (but you don't derive classes from this anyhow...)
  52.  
  53.   QList<KProcess> *processList;
  54.  
  55.  public slots:
  56.  
  57.  void slotDoHousekeeping(int socket);
  58.  
  59. private:
  60.  
  61.   static void theSigCHLDHandler(int signal);
  62.   // handler for sigchld
  63.  
  64.   int fd[2];
  65.   QSocketNotifier *notifier;
  66.  
  67.   // Disallow assignment and copy-construction
  68.   KProcessController( const KProcessController& ) {};
  69.   KProcessController& operator= ( const KProcessController& ) { return *this; }
  70. };
  71.  
  72. extern KProcessController *theKProcessController;
  73.  
  74. #endif
  75.  
  76.